﻿<?php
	require_once("../connectMysql/connetMysql.class.php");
	$UserPhone=$_POST['userPhone'];
	
	$db=new connetMysql;
	$con=$db->getConnect();
	$get_idsql="SELECT UserId FROM user WHERE UserPhone='".$UserPhone."'";
	
	$result=$con->query($get_idsql);
	$row = mysqli_fetch_assoc($result);
	$Userid=$row['UserId'];
	
	$title=$_POST['title'];
	$atime=$_POST['atime'];
	$atype=$_POST['atype'];
	$acharge=$_POST['acharge'];
	$psum=$_POST['psum'];
	$address=$_POST['address'];
	$intro=$_POST['intro'];
	date_default_timezone_set('PRC');
    $ActPublishTime=date("Y-m-d h:i:s");	
	
		$sql = "INSERT INTO activity(UserId,ActPublish,actStarta,ActAddress,ActDescri,ActContent,actTypea,actLimitNuma,actChargea) 				VALUES('".$Userid."','".$ActPublishTime."','".$atime."','".$address."','".$title."','".$intro."','".$atype."','".$psum."','".$acharge."')";
		
		
		$result = mysqli_query($con,$sql);
		$success_respon = array('code' => 'RELEASE_SUCCESS', 'msg' => '1');
		echo json_encode($success_respon);
		$con->close();
		
	
?>